// Jocara game project

#include "precompiled_header.h"
#include "main_menu.h"
#include "game.h"

using namespace std;

int main(int /* argc */, char** /* argv */) {
  SDL_Init(SDL_INIT_EVERYTHING);
  TTF_Init();
  SDL_SetVideoMode(1024, 768, 32,
                   SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_ASYNCBLIT);
  //SDL_SetVideoMode(0, 0, 32,
  //            SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
  SDL_WM_SetCaption("Jocara pre-alpha 0.1","Jocara");
  // TODO: Get rid of hardcoded paths
  kData[0] = LoadImage("menu.png", true);
  kData[1] =  LoadImage("darken.png", true);
  kData[2] =  LoadImage("alphas.png", true);
  kData[3] =  LoadImage("tiles.png");
  kFontSmall = TTF_OpenFont("data/Jester.ttf", 8);
  kFontNormal = TTF_OpenFont("data/Jester.ttf", 20);
  kFontBig = TTF_OpenFont("data/Jester.ttf", 36);
  GameModes game_mode = kMainMenu;
  while(game_mode != kQuit) {
    switch(game_mode) {
    case kMainMenu:
      game_mode = MainMenu();
      break;
    case kGame:
      game_mode = Game();
      break;
    default:
      game_mode = MainMenu();
    }
  }
  SDL_Quit();
  TTF_Quit();
  return 0;
}
